<?php	
	require_once KLEO_LIB_DIR.'core.lib.php';

	class themes extends themesmodel{
		function load_dir(&$buff){
			$buff = str_replace("</head>", '<link href="modules/themes/media/style.css" rel="stylesheet" type="text/css" />'."\n</head>", $buff);
			$query = $this->query("SELECT * FROM ".KLEO_TABLE_PREFIX."portal_themes_dir ORDER BY id DESC");
			$themes_buff;
			while($row = $this->fetch_array($query)){
				$this->tpl_load('item.tpl', $theme_item);
				$this->tpl_set(array(
					"THEME_NAME" => $row['name'],
					"THEME_DESC" => $row['desc'],
					"THEME_LICENCE" => $row['licence']
				), false, $theme_item, $theme_item);
				$themes_buff .= $theme_item;
			}
			$this->tpl_set("WEB_CONTENT", $themes_buff, $buff, $buff);
			$this->tpl_set("BREADCRUMB", '<a href="index.php">Home</a> » <a href="?module=themes">Themes</a>', $buff, $buff);
		}
	}
?> 
